package com.wc.alorithm_blue_bridge._二分.Q3990;

import java.io.*;

/**
 * @Author congege
 * @Description 妮妮的月饼工厂
 * https://www.lanqiao.cn/problems/3990/learning/?page=1&first_category_id=1
 * @Date Created in 2023/11/25-14:33
 */
public class Main {
    public static void main(String[] args) {
        Input sc = new Input();

        int n = sc.nextInt();
        long k = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }

        int left = 1;
        int right = (int) 1e9;
        int mid;
        while (left <= right) {
            mid = left + (right - left) / 2;
            if (check(k, array, mid)) {
                left = mid + 1;
            } else {
                right = mid - 1;
            }
        }

        if (left == 1) {
            left = 0;
        }
        System.out.println(left - 1);
    }

    public static boolean check(long k, int[] array, int height) {
        long ans = 0;
        for (int num : array) {
            ans += num / height;
        }
        return ans >= k;
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (Exception e) {
                return -1;
            }
            return (int) in.nval;
        }
    }
}
